<%- include('common/head.ejs') %>
<link rel="stylesheet" href="/stylesheets/goods_info.css"/>
<%- include('common/body.ejs') %>
<%- include('common/head-nav.ejs') %>
<div class="goods-info">
    <div class="goods-info-content">
        <div class="goods-left">
            <% goodsInfo.image.forEach(function(item, index){ %>
            <img src="<%= item[0].substring(6) %>" class="big-img">
            <% }) %>

            <ul>
                <% goodsInfo.image.forEach(function(item, index){ %>
                <li><img src="<%= item[0].substring(6) %>" class="small-img"/></li>
                <% }) %>
            </ul>
        </div>
        <div class="goods-right">
            <h3><%= goodsInfo.name %></h3>
            <div class="goods-top">
                <div class="price">
                    <span>价格</span>
                    <span class="price-num">￥<%= goodsInfo.price %></span>

                    <div class="common" style="right: 80px;border-right: 1px solid #ffe4d0;">
                        <a href="javascript:;">
                            <p class="text-center">0</p>

                            <p>累计评论</p>
                        </a>
                    </div>
                    <div class="common">
                        <a href="javascript:;">
                            <p class="text-center">0</p>

                            <p>交易成功</p>
                        </a>
                    </div>
                </div>
                <div class="give">
                    <span>地址</span>
                    <span>湖北建州 至 河北石家庄</span>
                    <span>快递 ￥8.00</span>

                </div>
            </div>
            <div class="goods-bottom">
                <ul style="padding-left: 20px">
                    <li class="size">
                        <span>尺码</span>
                        <ul id="size">
                            <% goodsInfo.info.forEach(function(item, index){ %>
                            <a href="javascript:;" data-status="false" data-count="<%= item.count %>">
                                <li class="item"><%= item.size %></li>
                            </a>
                            <% }) %>
                        </ul>
                    </li>
                    <li class="size">
                        <span>数量</span>

                        <div class="num">
                            <button id="dec"><span class="glyphicon glyphicon-minus" style="color: #000;"></span>
                            </button>
                            <input type="text" id="num" value="1"/>
                            <button id="add"><span class="glyphicon glyphicon-plus" style="color: #000;"></span>
                            </button>
                            <span> 件 (库存</span>
                            <span id="oddTotal"><%= goodsTotal %></span>
                            <span>件)</span>
                        </div>
                    </li>
                    <li class="size">
                        <button class="buy-btn btn-" onclick="buyGoods()">立即购买</button>
                        <button class="cart-btn btn-" onclick="addCart()"><span
                                    class="glyphicon glyphicon-shopping-cart"
                                    style="color: #fff;margin: 0 10px;"></span>加入购物车
                        </button>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <div class="goods-describe">
        <div class="content-left equal"></div>

        <div class="content-center" data-val="<%= goodsInfo.describe %>">
            <nav class="navbar navbar-default" role="navigation" style="border-radius: 0">
                <div>
                    <ul class="nav navbar-nav">
                        <li class="active" id="describe"><a href="javascript:showContent('describe')">宝贝详情</a></li>
                        <li id="comment"><a href="javascript:showContent('comment')">评论</a></li>
                    </ul>
                </div>
            </nav>
            <div class="goods-content">
            </div>
            <div class="comment">
                <div class="content" style="width: 800px;height: 500px;">
                    <ul class="item">
                        <li><a href="javascript:;" style="color: #f40;">全部</a></li>
                        <li><a href="javascript:;">好评(2)</a></li>
                        <li><a href="javascript:;">中评(0)</a></li>
                        <li><a href="javascript:;">差评(0)</a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="content-right equal"></div>
    </div>
</div>

<script src="/javascripts/buyGoods.js"></script>
<%- include('common/footer.ejs') %>